﻿<ContentControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:control="clr-namespace:Corina.Controls.Silverlight;assembly=Corina.Controls.Silverlight"
                xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
                HorizontalContentAlignment="Stretch"
                VerticalContentAlignment="Stretch"
                FontSize="14"
                d:DesignHeight="600"
                d:DesignWidth="1000"
                mc:Ignorable="d">
    <Grid>
        <control:TiledBackground SourceUri="/Corina.Lantern.Hub;component/Images/backgroundtexture.png" />
        <Image Source="/Corina.Lantern.Hub;component/Images/backgroundshadow.png" Stretch="Fill" />

        <Border x:Name="BackgroundBorder" Style="{StaticResource BackgroundBorderStyle}" />

        <Border x:Name="LinksBorder" Style="{StaticResource NavLinksBorderStyle}">
            <Grid Width="{StaticResource ContentMaxWidth}" HorizontalAlignment="Center" />
        </Border>

        <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" MinHeight="50" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <ScrollViewer Grid.Row="1"
                          BorderThickness="0"
                          ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                          ScrollViewer.VerticalScrollBarVisibility="{Binding VerticalScrollBarVisibility}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <Border x:Name="BrandingBorder" Style="{StaticResource NavBrandingBorderStyle}">
                            <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource NavBrandingStackPanelStyle}">
                                <TextBlock x:Name="ApplicationNameTextBlock"
                                           Margin="12,6"
                                           Style="{StaticResource ApplicationNameStyle}"
                                           Text="泊银科技" />
                                <ContentControl Margin="0,8"
                                                VerticalAlignment="Bottom"
                                                Content="安全检测信息管理系统"
                                                Style="{StaticResource NavLogoIcon}" />
                            </StackPanel>
                        </Border>

                        <ListBox Grid.Column="1"
                                 VerticalAlignment="Bottom"
                                 Background="Transparent"
                                 BorderThickness="0"
                                 ItemContainerStyle="{StaticResource NavigatorStyle}"
                                 ItemsSource="{Binding Navigations}"
                                 SelectedItem="{Binding SelectedWeburl,
                                                        Mode=TwoWay}"
                                 Style="{StaticResource STYLE_NAVIBOX}">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VirtualizingStackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                        </ListBox>
                    </Grid>

                    <Border x:Name="ContentBorder"
                            Grid.Row="1"
                            VerticalAlignment="Stretch"
                            Style="{StaticResource NavContentBorderStyle}">
                        <navigation:Frame x:Name="ContentFrame"
                                          JournalOwnership="OwnsJournal"
                                          Padding="12,0"
                                          Source="{Binding ViewUrl}"
                                          Style="{StaticResource NavContentFrameStyle}" />
                    </Border>

                    <Grid Grid.Row="2" Margin="12,6">
                        <StackPanel>
                            <TextBlock Text="© 2014 泊银科技" />
                        </StackPanel>
                        <TextBlock HorizontalAlignment="Right" Visibility="{Binding IsValid, Converter={StaticResource BooleanToVisibilityConverter}}">
                            <Run Text="当前登录：" />
                            <Run Text="{Binding CurrentAccount.Account}" />
                            <Run Text="【" />
                            <Run Text="{Binding CurrentAccount.Name}" />
                            <Run Text="】" />
                        </TextBlock>
                    </Grid>
                </Grid>
            </ScrollViewer>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <ListBox VerticalAlignment="Top"
                         ItemContainerStyle="{StaticResource STYLE_MAINNATISTYLE}"
                         ItemsSource="{Binding TopurlCollection}"
                         SelectedItem="{Binding SelectedTopurl,
                                                Mode=TwoWay}"
                         Style="{StaticResource STYLE_NAVIBOX}">

                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>

                <Grid Grid.Column="1"
                      Height="40"
                      VerticalAlignment="Top">
                    <StackPanel Orientation="Horizontal">
                        <HyperlinkButton Margin="12,0"
                                         VerticalAlignment="Center"
                                         Command="{Binding LogoutCommand}"
                                         Content="退出登录"
                                         FontSize="14"
                                         Foreground="Black"
                                         Visibility="{Binding IsValid,
                                                              Converter={StaticResource BooleanToVisibilityConverter}}" />
                        <ToggleButton Height="16"
                                      VerticalAlignment="Center"
                                      IsChecked="{Binding FullScreen,
                                                          Mode=TwoWay}"
                                      Style="{StaticResource FullScreenButtonStyle}" />
                    </StackPanel>

                </Grid>


            </Grid>

        </Grid>
    </Grid>
</ContentControl>
